package com.xfb.user.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

public interface UserMapper {

    @Select(
            "select * from lagou_auth_code where email = #{email}"
    )
    Map selectUser(@Param("email") String email);

    @Select(
            "select * from lagou_token where token = #{token}"
    )
    Map selectUserToken(@Param("token") String token);

    @Select(
            "select * from lagou_auth_code where email = #{email} and code = #{code}"
    )
    Map selectRegisterCode(@Param("email") String email, @Param("code") String code);

    @Insert(
            "insert into lagou_token(email, token) values(#{email},#{token})"
    )
    int insertToken(@Param("email") String email, @Param("token") String token);
}

